#include <iostream>

using namespace std;

int main(int argc, char const *argv[])
{
    int a[3] = {0};


    for (int i = 0; i < 3; i++)
    {
        cout <<"请输三角形的第 "<< i + 1 << "边长"<<endl;
        cin >> a[i];
    }
    cout <<"输入的三角形的边长分变为 "<<endl;

    for (int i = 0; i < 3; i++)
    {
        cout << a[i] <<" ";
    }
    cout <<endl;

    int temp = 0;

    for (int i = 0; i < 3; i++)
    {
        for (int j = i + 1; j < 3; j++)
        {
            if (a[i] < a[j])
            {
                int temp = a[i];
                a[i] = a[j];
                a[j] = temp;
            }
        }
    }
    cout <<"输入的三角形三边从大到小排列为" <<endl;

    for (int i = 0; i < 3; i++)
    {
        cout << a[i] <<" ";
    }
    cout << endl;
    if(a[0] >= a[1] + a[2])
    {
        cout << "您输入的三角形三边长不合法"<<endl;
    }
    else if(a[0] * a[0] == a[1] * a[1] + a[2] * a[2])
    {
        cout << "您输入的三角形为直角三角形"<< endl;
    }
    else if(a[0] == a[1] &&a[1] == a[2])
    {
        cout << "您输入的三角形为等边三角形" <<endl;
    }
    else if(a[1] == a[2] || a[0] == a[1])
    {
        cout << "您输入的三角形为等腰三角形" <<endl;
    }
    else
        cout << "您输入的三角形为普通三角形" <<endl;

    return 0;
}
